local choulue = fk.CreateSkill{
    name = "wk_heg__choulue",
}

Fk:loadTranslationTable{
    ["wk_heg__choulue"] = "筹略",
    [":wk_heg__choulue"] = "①当你受到伤害后，若你的“阴阳鱼”标记数小于你体力上限，你可获得一个“阴阳鱼”标记；②当与你势力相同的角色使用普通锦囊牌指定唯一目标后，你可移去一个“阴阳鱼”标记，令此牌结算两次。",

    ["#wk_heg__choulue-getfish"] = "筹略：是否获得一个“阴阳鱼”标记",
    ["#wk_heg__choulue-twice"] = "筹略：是否移去一个“阴阳鱼”标记，令此牌结算两次",

    ["$wk_heg__choulue1"] = "筹画所料，无有不中。",
    ["$wk_heg__choulue2"] = "献策破敌，所谋皆应。",
}

local H = require "packages.ol_hegemony.util"

choulue:addEffect(fk.Damaged,{
    anim_type = "offensive",
    can_trigger = function (self, event, target, player, data)
       return player == target and player:hasSkill(choulue.name) and player:getMark("@!!yinyangfish") < player.maxHp
    end,
    on_cost = function (self, event, target, player, data)
       return player.room:askToSkillInvoke(player, {skill_name = choulue.name, prompt = "#wk_heg__choulue-getfish" })
    end,
    on_use = function (self, event, target, player, data)
        local room = player.room
        H.addHegMark(room, player, "yinyangfish")
    end,
})

choulue:addEffect(fk.TargetSpecified,{
    anim_type = "offensive",
    can_trigger = function (self, event, target, player, data)
        return player:hasSkill(choulue.name) and H.compareKingdomWith(player, target) and data:isOnlyTarget(data.to)
        and data.card:isCommonTrick() and player:getMark("@!!yinyangfish") ~= 0
    end,
    on_cost = function (self, event, target, player, data)
       return player.room:askToSkillInvoke(player, {skill_name = choulue.name, prompt = "#wk_heg__choulue-twice" })
    end,
    on_use = function (self, event, target, player, data)
        local room = player.room
        H.removeHegMark(room, player, "yinyangfish")
        data.use.additionalEffect = 1
    end,
})

return choulue